package com.xxx.corejava.day1209;

public class Test3 {

    public static void main(String[] args) throws Exception {
        User u1=new User();
        u1.setName("abc");
        u1.setAge(21);
        u1.setSex(true);
        Address a1=new Address();
        a1.setCity("南京");
        u1.setAddress(a1);
        System.out.println(u1);
        System.out.println(u1.getAddress());

        User u2= (User) u1.clone();
        System.out.println(u2.getName());
        System.out.println(u2.getAge());
        System.out.println(u2.isSex());
        System.out.println(u2.getAddress().getCity());
        System.out.println(u2);
        System.out.println(u2.getAddress());

        new User();

        System.gc();
        Runtime.getRuntime().gc();
    }
}
